Function reference previous pagenext page

3.1: uix.Grid Go back up one level


Arrange elements in a two dimensional grid

obj = uix.Grid( )
creates a new new grid layout with all properties set to defaults. The number of rows and columns to use is determined from the number of elements in the Heights and Widths properties respectively. Child elements are arranged down column one first, then column two etc. If there are insufficient columns then a new one is added. The output is a new layout object that can be used as the parent for other user-interface components.
obj = uix.Grid( prop, value, ... )
also sets one or more property values.

uix.Grid properties

PropertyValueDescription
BackgroundColor colorspecColor to use for exposed areas of the layout background. This can be an RGB triple (e.g. [0 0 1]) or a colour name (e.g. 'b').
BeingDeleted on | offDeletion status.
Contents empty GraphicsPlaceholder array | array of graphics objectsChildren within this layout, regardless of HandleVisibility. Note that this can only be set to permutations of itself.
DeleteFcn function_handleFunction to call when the layout is being deleted.
Heights double vectorHeight of each of the rows. Positive entries indicate fixed sizes in pixels, negative values indicate relative weights for resizing.
Padding positive integerNumber of pixels of extra space around the outside of the layout.
Parent empty GraphicsPlaceholder array | figure | containerParent of the layout.
Position [x y w h]Position (x,y) and size (w,h) within figure or container.
Spacing positive integerNumber of pixels of extra space to leave between elements in the layout.
Tag stringTag to associate with layout.
Type stringType of graphics object.
Units inches | centimeters | normalized | points | pixels | charactersPosition units.
Visible on | offVisibility.
Widths double vectorWidth of each of the columns. Positive entries indicate fixed sizes in pixels, negative values indicate relative weights for resizing.

For example:

f = figure();
g = uix.Grid( 'Parent', f, 'Spacing', 5 );
uicontrol( 'Parent', g, 'Background', 'r' )
uicontrol( 'Parent', g, 'Background', 'b' )
uicontrol( 'Parent', g, 'Background', 'g' )
uix.Empty( 'Parent', g )
uicontrol( 'Parent', g, 'Background', 'c' )
uicontrol( 'Parent', g, 'Background', 'y' )
set( g, 'Widths', [-1 100 -2], 'Heights', [-1 100] );


See also:
© 2016 The MathWorks Ltd Terms of Use Patents Trademarks